//
//  MineLeftHeadCVCell.m
//  Shine
//
//  Created by dllo on 16/3/10.
//  Copyright © 2016年 王斌. All rights reserved.
//

#import "MineLeftHeadCVCell.h"
#define WIDTHCVCELL self.contentView.frame.size.width
#define HEIGHTCVCELL self.contentView.frame.size.height
@implementation MineLeftHeadCVCell
- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell{

    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.titleLabel];
    
    self.kcalNumberLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.kcalNumberLabel];
    
    self.kcalLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.kcalLabel];
    
    self.progressView = [[UIProgressView alloc] init];
    [self.contentView addSubview:self.progressView];
    
    self.objectivesLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.objectivesLabel];
}

- (void)layoutSubviews{
    [super layoutSubviews];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(10);
        make.left.mas_equalTo(20);
        make.width.mas_equalTo(WIDTHCVCELL);
        make.height.mas_equalTo(30);
    }];
    
    [self.kcalNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(40);
        make.left.mas_equalTo(20);
        make.width.mas_equalTo(150);
        make.height.mas_equalTo(70);
    }];
    self.kcalNumberLabel.font = [UIFont systemFontOfSize:50];
    self.kcalNumberLabel.textAlignment = YES;
    
    [self.kcalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(80);
        make.left.mas_equalTo(260);
        make.width.mas_equalTo(100);
        make.height.mas_equalTo(30);
    }];
    
    [self.progressView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(110);
        make.left.mas_equalTo(20);
        make.width.mas_equalTo(WIDTHCVCELL-50);
        make.height.mas_equalTo(2);
    }];
    
    [self.objectivesLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(130);
        make.left.mas_equalTo(20);
        make.width.mas_equalTo(WIDTHCVCELL);
        make.height.mas_equalTo(30);
    }];
}



@end
